{% if url=='/bd/my_demand_publish'%}
{% extends "info.html" %}
{% else %}
{% extends "base.html" %}
{% endif %}
{% block content %}

<div class="row" style="overflow:hidden; text-overflow:ellipsis;">
    <div class="col-md-10">
        <div class="box">
            <div class="box-header with-border">
                <h3 class="box-title">--</h3>
            </div><!-- /.box-header -->
            <div class="box-body">
                <table class="table table-bordered">
                    <tr>
                        <th style="width: 10px">#</th>
                        <th>标题</th>
                        <th>描述</th>
                        <th>区县</th>
                        <th>地铁线</th>
                        <th>价格区间</th>
                        <th>发布日期</th>
                        <th style="width: 40px"></th>
                    </tr>
                    {% if demands %}
                    {% for f in demands %}
                    <tr>
                        <td>

                        </td>
                        <td>
                           <a href="/view_demand?id={{f.id}}">
                                {{f.title}}
                            </a>
                        </td>
                        <td>
                            {{f.description}}
                        </td>
                        <td>
                            {{f.area.name}}
                        </td>
                        <td>
                            {{f.subway.name}}
                        </td>
                        <td>
                            {{f.price_low}}~{{f.price_high}}元/月
                        </td>
                        <td>
                            {{f.date}}
                        </td>
                        <td>
                            <form action="" method="post" name="edit_school" onsubmit="return confirm('确认要提交吗?');">
                                <input type="hidden" name="id" value="{{f.id}}">
                                {% if current_user.role_id == 1%}<input type="submit" value="删除" name="delete">{% endif%}
                            </form>
                        </td>
                    </tr>
                    {% endfor %}
                    {% endif %}

                </table>
            </div>
            <div class="box-footer clearfix">
                <ul class="pagination pagination-sm no-margin pull-right">
                    {% if paging %}
                    <li><a href="javascript:genPagingRef('{{url}}?page=1');">&laquo;</a></li>
                    {% for i in range(paging.page_from,paging.page_to+1) %}

                    <li><a href="javascript:genPagingRef('{{url}}?page={{i}}');">{{i}}</a></li>

                    {% endfor %}
                    <li><a href="javascript:genPagingRef('{{url}}?page={{paging.total_pages}}');">&raquo;</a></li>
                    {% endif %}

                </ul>
            </div>
        </div>






        {% endblock %}
